const storageManager = require('../storage');

/**
 * 项目信息资源
 */
module.exports = {
  name: 'project-info',
  description: '当前项目的基本信息',
  handler: async () => {
    try {
      const currentProject = storageManager.getCurrentProject();
      const projectData = storageManager.loadProject(currentProject);
      
      return {
        name: projectData.project.name,
        description: projectData.project.description,
        createdAt: projectData.project.createdAt,
        updatedAt: projectData.project.updatedAt,
        stats: {
          utils: projectData.utils.length,
          tables: projectData.database.tables.length,
          apis: projectData.apis.length,
          workflows: projectData.workflows.length
        }
      };
    } catch (error) {
      return {
        error: error.message
      };
    }
  }
}; 